package org.rpc.proxy.jdk;

import org.rpc.proxy.ProxyFactory;

import java.lang.reflect.Proxy;

/**
 * jdk的代理事项
 */
public class JDKProxy implements ProxyFactory {
    @Override
    public <T> T getProxy(Class<T> clazz) {
        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz},new JDKInvocationHandler(clazz));
    }
}
